<template>
    <div>
        <ItemMusicTop :playlist="playList"></ItemMusicTop>
        <ItemMusicBottom :subscribedCount="playList.subscribedCount" :id='id'></ItemMusicBottom>
    </div>
</template>

<script>
import ItemMusicTop from '../components/itemMusic/ItemMusicTop.vue'
import ItemMusicBottom from '../components/itemMusic/ItemMusicBottom.vue'
export default {
    name: 'ItemMusic',
    data() {
        return {
            id: '',
            playList: []
        }
    },
    components: {
        ItemMusicTop,
        ItemMusicBottom
    },
    methods: {
        async getPlayList(){
            await this.$axios.get(`/playlist/detail?id=${this.id}`).then(res=>{
                console.log(res);
                this.playList=res.data.playlist;
            }).catch(err=>{
                console.log(err);
            })
        },
    },
    created() {
        this.id=this.$route.query.id;
        this.getPlayList();
    },
    mounted() {
        
    }
}
</script>

<style>

</style>